#ifndef _BUBBLE_SORT_H_
#define _BUUBLE_SORT_H_
#include<vector>
class BubbleSort
{
public:
    static void sort(vector<int> &array,int length)
    {
        if (length < 2)
        {
            return ;
        }
        for (int end = length - 1; end > 0; end--)
        {
            for (int i = 0; i < end; i++)
            {
                if (array[i] > array[i + 1])
                {
                    swap(array, i ,i+1);
                }       
            }
        }
    }
    static void swap(vector<int> &arr, int i, int j)
    {
        int tem = arr[i];
        arr[i] = arr[j];
        arr[j] = tem;
    }
};
#endif